<div class="relative">
  <button class="button button__sm button__transparent-secondary" data-controller="dropdown" data-target="<%= dropdown_id(filters) %>">
    <% if filters.present? %>
      <%= t("actions.export-selection", scope: "decidim.admin") %>
    <% else %>
      <%= t("actions.export", scope: "decidim.admin") %>
    <% end %>
    <%= icon "arrow-down-s-line" %>
    <%= icon "arrow-down-s-line" %>
  </button>

  <ul id="<%= dropdown_id(filters) %>" class="dropdown dropdown__bottom" aria-hidden="true">
    <% component.manifest.export_manifests.each do |manifest| %>
      <% manifest.formats.each do |format| %>
        <li class="dropdown__item">
          <%= link_to exports_path(component, id: manifest.name, format:, resource_id:, filters:), class: "dropdown__button", method: :post do %>
            <%= t("decidim.admin.exports.export_as", name: t("decidim.#{component.manifest.name}.admin.exports.#{manifest.name}"), export_format: t("decidim.admin.exports.formats.#{format}")) %>
          <% end %>
        </li>
      <% end %>
    <% end %>
  </ul>
</div>
